博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Csharp:user WebControl Read Adobe PDF Files In Your Web Browser
阅读量:4561 次
发布时间:2019-06-08

本文共 2218 字,大约阅读时间需要 7 分钟。

namespace GeovinDu.PdfViewer{    [DefaultProperty("FilePath")]    [ToolboxData("<{0}:ShowPdf runat=server>
")] public class ShowPdf : WebControl { #region "Declarations" //Geovin Du 塗聚文 20131010 private string mFilePath;#endregion #region "Properties" [Category("Source File")] [Browsable(true)] [Description("Set path to source file.")] [Editor(typeof(System.Web.UI.Design.UrlEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FilePath { get { return mFilePath; } set { if (value == string.Empty) { mFilePath = string.Empty; } else { int tilde = -1; tilde = value.IndexOf('~'); if (tilde != -1) { mFilePath = value.Substring((tilde + 2)).Trim(); } else { mFilePath = value; } } } } // end FilePath property#endregion #region "Rendering" /// /// Geovin Du 塗聚文 20131010 /// /// protected override void RenderContents(HtmlTextWriter writer) { try { StringBuilder sb = new StringBuilder(); sb.Append(""); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(sb.ToString()); writer.RenderEndTag(); } catch { // with no properties set, this will render "Display PDF Control" in a // a box on the page writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Display PDF Control"); writer.RenderEndTag(); } // end try-catch } // end RenderContents #endregion } // end class} // end namespace Geovin Du 塗聚文 20131010

 

转载于:https://www.cnblogs.com/geovindu/p/3361704.html

你可能感兴趣的文章
Cortex-M3 异常返回值EXC_RETURN
查看>>
kettle 转换字段遇到问题(couldn't get row from result set)——摘
查看>>
nginx首页根据IP跳转
查看>>
【2019-08-20】有点目标,有点计划,有点目的
查看>>
【2019-09-10】美,真的跟年龄无关
查看>>
【2019-09-28】少,但更好
查看>>
【2019-09-13】耐心观察是一种技能
查看>>
mysql数据库2-常用命令
查看>>
安卓开发环境搭建(转)
查看>>
Harris角点检测
查看>>
Struts2的处理流程及为Action的属性注入值
查看>>
设计中最常用的CSS选择器
查看>>
Maven项目打包成可执行Jar文件
查看>>
nginx http proxy 正向代理
查看>>
对BFC的总结
查看>>
23醒
查看>>
win7每天出现taskeng.exe进程的解决方案
查看>>
React Children
查看>>
大数据等最核心的关键技术:32个算法
查看>>
Maven多模块项目搭建
查看>>